<template>
  <a-modal
    :visible="visible"
    title="开题报告"
    :width="1600"
    :bodyStyle="{
      'max-height': '60vh',
      overflow: 'auto'
    }"
    @cancel="() => { $emit('cancel') }"
  >
    <detail-list :col="4">
      <detail-list-item term="学号">{{ rptInfo.xh }}&nbsp;</detail-list-item>
      <detail-list-item term="姓名">{{ rptInfo.xm }}&nbsp;</detail-list-item>
      <detail-list-item term="院系">{{ rptInfo.dwmc }}&nbsp;</detail-list-item>
      <detail-list-item term="专业">{{ rptInfo.zymc }}&nbsp;</detail-list-item>
      <detail-list-item term="研究方向">{{ rptInfo.yjfx }}&nbsp;</detail-list-item>
      <detail-list-item term="学生类别">{{ rptInfo.xslbmc }}&nbsp;</detail-list-item>
      <detail-list-item term="入学年月">{{ rptInfo.rxny && rptInfo.rxny.format('YYYY-MM-DD') }}&nbsp;</detail-list-item>
      <detail-list-item term="导师姓名">{{ rptInfo.dsxm }}&nbsp;</detail-list-item>
      <detail-list-item term="平均绩点">{{ rptInfo.pjjd }}&nbsp;</detail-list-item>
      <detail-list-item term="课程学习情况">已修{{ rptInfo.yxxf || 0.0 }}学分&nbsp;</detail-list-item>
      <detail-list-item term="有无重修课程">{{ rptInfo.ywcxkc }}&nbsp;</detail-list-item>
      <detail-list-item term="拟定论文题目">{{ rptInfo.ndlwtm }}&nbsp;</detail-list-item>
      <detail-list-item term="题目来源">{{ rptInfo.tmly }}&nbsp;</detail-list-item>
      <detail-list-item term="是否不宜公开">{{ rptInfo.sfsmmc }}</detail-list-item>
    </detail-list>
    <div style="margin: 10px 0;font-weight: bold;font-size: 16px;">一、选题依据及意义</div>
    <p v-html="rptInfo.xtyy && rptInfo.xtyy.replace(/\n|\r\n/g,'<br/>')"></p>
    <div style="margin: 10px 0;font-weight: bold;font-size: 16px;">二、所要解决的主要问题及研究途径与方法（预期思路与技术路线）</div>
    <p v-html="rptInfo.yqsl && rptInfo.yqsl.replace(/\n|\r\n/g,'<br/>')"></p>
    <div style="margin: 10px 0;font-weight: bold;font-size: 16px;">三、研究进度和具体时间安排</div>
    <a-table
      :columns="columns"
      :dataSource="rptInfo.yjjds"
      size="middle"
      :pagination="false"
      :scroll="{ y: 240 }"
    >
      <span slot="serial" slot-scope="text, record, index">
        {{ index + 1 }}
      </span>
      <span slot="qsrq" slot-scope="text, record">
        {{ text&&moment(text).format('YYYY.MM.DD') }}-{{ record.jsrq && moment(record.jsrq).format('YYYY.MM.DD') }}
      </span>
    </a-table>
    <template>
      <div style="margin: 10px 0;font-weight: bold;font-size: 16px;">开题报告状态:</div>
      <p>{{ rptInfo.ktbgztmc }}</p>
    </template>

    <div style="margin: 10px 0;font-weight: bold;font-size: 16px;">导师对开题的评议：</div>
    <p v-html="rptInfo.dspy && rptInfo.dspy.replace(/\n|\r\n/g,'<br/>')"></p>
    <div style="margin: 10px 0;font-weight: bold;font-size: 16px;">评审专家意见：</div>
    <div>一、对选题依据、预期目标和技术路线的科学性、先进性及创新性的评价</div>
    <p v-html="rptInfo.pszjyj1 && rptInfo.pszjyj1.replace(/\n|\r\n/g,'<br/>')"></p>
    <div>二、存在的主要问题和改进措施</div>
    <p v-html="rptInfo.pszjyj2 && rptInfo.pszjyj2.replace(/\n|\r\n/g,'<br/>')"></p>
    <div>三、评审专家</div>
    <a-table
      rowKey="index"
      :columns="zjcolumns"
      :dataSource="rptInfo.pszyList"
      :pagination="false"
    >
      <span slot="szdw" slot-scope="text, record, index">
        {{ record.szdw+"、"+record.xcszy}}
      </span>
    </a-table>
    <template v-if="rptInfo.ktbgzt === '09' || rptInfo.ktbgzt === '08' || rptInfo.ktbgzt === '78'">
      <div style="font-size: 18px">院系审核结果</div>
      {{ rptInfo.ktbgzt === '09' ? '同意' : (rptInfo.ktbgzt === '08' ? '不同意' : '建议修改或补充') }}
    </template>
    <template slot="footer">
      <a-button  type="primary" @click="exportPdf()">导出开题报告</a-button>
      <a-button  type="primary" @click="() => { $emit('cancel') }">关闭</a-button>
    </template>

  </a-modal>

</template>

<script>
  import {STable} from '~'
  import DetailList from '~/tool/DetailList'
  import moment from 'moment'
  const DetailListItem = DetailList.Item

  export default {
    props: ['visible'],
    components: {DetailList, DetailListItem, STable},
    data() {
      return {
        moment,
        rptInfo: {
          yjjds: []
        },
        columns: [
        {
          title: '起讫日期',
          width: 200,
          dataIndex: 'qsrq',
          scopedSlots: { customRender: 'qsrq' }
        },
        {
          title: '主要研究内容',
          dataIndex: 'zyyjnr'
        },
        {
          title: '预期结果',
          width: 650,
          dataIndex: 'yqjg'
        }
      ],
      tableData: [],
      zjcolumns: [
        {
          title: '姓名',
          dataIndex: 'xm',
        },
        {
          title: '职称',
          dataIndex: 'zc',
        },
        {
          title: '所在单位、现从事专业',
          dataIndex: 'szdw',

          scopedSlots: {customRender: 'szdw'}
        }
      ]
    }
  },
  mounted(){
  },
  methods:{
    exportPdf(){
      console.log(this.rptInfo)
      this.$export('/foster/ktbgxx/exportPdf?id='+this.rptInfo.id,{})
      // this.$export(`/foster/ktbgxx/exportPdf/${this.rptInfo.id}`)
    }
  }
}
</script>

<style>

</style>
